package com.neutech.service.impl;

import com.neutech.mapper.RoomMapper;
import com.neutech.service.RoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class RoomServiceImpl implements RoomService {

    @Autowired
    private RoomMapper roomMapper;

    @Override
    public List<Map<String, Object>> queryroom() {
        return roomMapper.queryroomlist();
    }

    @Override
    public List<Map<String, Object>> queryroombyid(Integer id) {
        return roomMapper.queryroombyid(id);
    }

    @Override
    public void delroom(Integer id) {
        roomMapper.delroombyid(id);

    }

    @Override
    public void addroom(Map<String, Object> map) {
        for (Object key : map.keySet()) {
            Object  value = map.get(key);
            map.put((String) key,value);
        }
        roomMapper.addroom(map);

    }
}
